using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Configuration;
using System.Xml;
using System.Text.RegularExpressions;
using System.Web.UI;
using System.IO;
using System.Collections.Specialized;
using System.Reflection;

namespace ExtraClub.Domain
{
    public partial class RewriteModule : IHttpModule
    {
        #region Rules
        private static string ContentPage_Rule(Regex rex, string path)
        {
            HttpRequest Request = HttpContext.Current.Request;

			string pageName = rex.Match(path).Groups["Page"].Value.ToLower();
			string domain = "default";
			int pos = path.LastIndexOf("/");
			if (pos > 0) {
				domain = path.Substring(1, pos - 1);
			}
			string sub_domain = "/";
			if (domain == "admin") {
				sub_domain = "/admin/";
			}

            path = sub_domain + "default.aspx?page=" + pageName + "&domain=" + domain;

            return path;
        }
        #endregion
    }
}